package probability;

import basics.DenseVector;
import basics.Vector;

public class UniformDistribution extends ProbabilityDistribution {

	private double _val;

	protected UniformDistribution() {

	}

	public UniformDistribution(double lower, double upper) {
		_params.add(new DenseVector(new double[] { lower }));
		_params.add(new DenseVector(new double[] { upper }));

		_val = 1. / (upper - lower);
	}

	@Override
	public double measure(Vector x) {
		return _val;
	}

	@Override
	protected ProbabilityDistribution newInstance() {
		return new UniformDistribution();
	}

	@Override
	public ProbabilityDistribution times(ProbabilityDistribution distribution) {
		// TODO Auto-generated method stub
		return null;
	}

}
